<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "{{%news}}".
 *
 * @property int $id 新闻 ID
 * @property string $title 标题
 * @property string $image 图片
 * @property string $description 简介
 * @property string|null $content 内容
 * @property int $status 状态
 */
class News extends \yii\db\ActiveRecord
{

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => '新闻 ID',
            'title' => '标题',
            'image' => '图片',
            'description' => '简介',
            'content' => '内容',
            'status' => '状态',
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['title'], 'required'],
            [['image', 'description', 'content'], 'string'],
            [['status'], 'integer'],
            [['title'], 'string', 'max' => 255],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%news}}';
    }
}
